package com.zfast.config.entity;

//import io.swagger.annotations.ApiModel;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

/**
 * @Classname Menu
 * @Description 菜单树
 * @Date 2019/7/16 23:09
 * @Created by WDD
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "t_sys_menu")
//@ApiModel(value = "Menu", description = "系统菜单")
public class Menu {
    @Id
    @GenericGenerator(name = "user-uuid", strategy = "uuid")
    @GeneratedValue(generator = "user-uuid")
    @Column(name = "id")
    private String id;
    @Column(name = "pid")
    private String pid;
    @Column(name = "name")
    private String name;
    @Column(name = "icon")
    private String icon;
    @Column(name = "url")
    private String url;

    @Transient
    private Boolean checked = false;

    //添加元素
    @Transient
    private List<Menu> children = new ArrayList<>();
}
